#!/usr/bin/python

import sys

for line in sys.stdin:
  line = line.strip()
  w, c = line.split('\t')
  c = int(c)
  if len(w) > 1:
    print '%04d\t%s' % (c, w)
